import request from '@/utils/request'

export function getCodeImg() {
  return request({
    url: '/captchaImage',
    method: 'get'
  })
}

export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 登录方法
export function login(username: string, password: string) {
  const data = {
    username,
    password
  }
  return request({
    url: '/login',
    headers: {
      isToken: false,
      repeatSubmit: false
    },
    method: 'post',
    data
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}
